<template>
  <div class="container">
    <!-- <h2 :class="['类名1', '类名2']">组件的样式问题</h2> -->
    <!-- <h2 :class="['abc', 'thin']">组件的样式问题</h2> -->

    <!-- <h2 :class="[类名1:布尔值, 类名2:布尔值]">组件的样式问题</h2> -->
    <h2 :class="{ abc: true, thin: flag }">组件的样式问题</h2>
    <button @click="flag = !flag">切换类名</button>

    <!-- <p :style="{ 样式名称: 值, 样式名称: 值 }">这是App中的p标签</p> -->
    <p :style="{ padding: '20px', fontSize: '20px' }">这是App中的p标签</p>
    <my-son></my-son>
  </div>
</template>

<script>
import MySon from "./components/MySon.vue";

export default {
  data() {
    return {
      flag: true,
    };
  },
  components: { MySon },
};
</script>

<style lang="less" scoped>
.abc {
  color: green;
}
.thin {
  font-weight: 200;
}
.container {
  background-color: skyblue;
  h2 {
    font-size: 24px;
  }
}
p {
  color: white;
}
//less样式穿透
.container /deep/ .thr {
  background-color: pink;
}
</style>
